/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.model;

import java.sql.Date;
import java.sql.Timestamp;

/**
 * created on 23.01.2008
 * 
 * This class represents an announcement which could be shown on the 
 * dashboard on the mygroupme page.
 * 
 * @author Mischa Frank, <a href="mailto:code@planetfrank.net">code@planetfrank.net</a>
 * @author last edited by: $Author: nicole $
 * 
 * @version $Revision: 1.5 $ $Date: 2008-10-22 16:49:56 $
 */
public class DashboardAnnouncement {
	
	public DashboardAnnouncement(){
		super();
	}
	
	public DashboardAnnouncement(int userId, int groupId, int resourceId, int tagId, 
			String action, Timestamp timestamp, String role, String groupName, 
			String resourceName, String tag){
		this.userId = userId;
		this.groupId = groupId;
		this.resourceId = resourceId;
		this.tagId = tagId;
		this.action = action;
		this.timestamp = timestamp;
		this.role = role;
		this.groupName = groupName;
		this.resourceName = resourceName;
		this.tag = tag;
	}
	
	private int userId;
	private int groupId;
	private int resourceId;
	private int tagId;
	private String action;
	private Timestamp timestamp;
	private String role;
	private String groupName;
	private String resourceName;
	private String tag;
	
	/**
	 * This method returns the action of a DashboardAnnouncement object.
	 * @return the action
	 */
	public String getAction() {
		return this.action;
	}
	/**
	 * This method sets the action of a DashboardAnnouncement object.
	 * @param action the action to set
	 */
	public void setAction(String action) {
		this.action = action;
	}
	/**
	 * This method returns the groupId of a DashboardAnnouncement object.
	 * @return the groupId
	 */
	public int getGroupId() {
		return this.groupId;
	}
	/**
	 * This method sets the groupId of a DashboardAnnouncement object.
	 * @param groupId the groupId to set
	 */
	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}
	/**
	 * This method returns the URL of the resource/group that was added/removed/tagged
	 * to/from/within a group.
	 * @return the URL of the resource/group
	 */
	public String getResourceURI() {
		return ObjectFactory.getResource(this.resourceId + "").getURI().toString();
	}
	/**
	 * This method returns the resourceId of a DashboardAnnouncement object.
	 * @return the resourceId
	 */
	public int getResourceId() {
		return this.resourceId;
	}
	/**
	 * This method sets the resourceId of a DashboardAnnouncement object.
	 * @param resourceId the resourceId to set
	 */
	public void setResourceId(int resourceId) {
		this.resourceId = resourceId;
	}
	/**
	 * This method returns the tagId of a DashboardAnnouncement object.
	 * @return the tagId
	 */
	public int getTagId() {
		return this.tagId;
	}
	/**
	 * This method sets the tagId of a DashboardAnnouncement object.
	 * @param tagId the tagId to set
	 */
	public void setTagId(int tagId) {
		this.tagId = tagId;
	}
	/**
	 * This method returns the timestamp of a DashboardAnnouncement object.
	 * @return the timestamp
	 */
	public Timestamp getTimestamp() {
		return this.timestamp;
	}
	
	/**
	 * This method returns the Date of a DashboardAnnouncement object as localized string.
	 * @return the date
	 */
	public String getDate(){
		//return this.timestamp.toLocaleString();
		return this.timestamp.toString();
	}
	
	/**
	 * This method sets the timestamp of a DashboardAnnouncement object.
	 * @param timestamp the timestamp to set
	 */
	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}
	/**
	 * This method returns the userId of a DashboardAnnouncement object.
	 * @return the userId
	 */
	public int getUserId() {
		return this.userId;
	}
	/**
	 * This method sets the userId of a DashboardAnnouncement object.
	 * @param userId the userId to set
	 */
	public void setUserId(int userId) {
		this.userId = userId;
	}

	/**
	 * This method returns the role of a DashboardAnnouncement object.
	 * @return the role
	 */
	public String getRole() {
		return role;
	}

	/**
	 * This method sets the role of a DashboardAnnouncement object.
	 * @param role the role to set
	 */
	public void setRole(String role) {
		this.role = role;
	}

	/**
	 * This method returns the groupName of a DashboardAnnouncement object.
	 * @return the groupName
	 */
	public String getGroupName() {
		return groupName;
	}

	/**
	 * This method sets the groupName of a DashboardAnnouncement object.
	 * @param groupName the groupName to set
	 */
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	/**
	 * This method returns the resourceName of a DashboardAnnouncement object.
	 * @return the resourceName
	 */
	public String getResourceName() {
		return resourceName;
	}

	/**
	 * This method sets the resourceName of a DashboardAnnouncement object.
	 * @param resourceName the resourceName to set
	 */
	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	/**
	 * This method returns the tag of a DashboardAnnouncement object.
	 * @return the tag
	 */
	public String getTag() {
		return tag;
	}

	/**
	 * This method sets the tag of a DashboardAnnouncement object.
	 * @param tag the tag to set
	 */
	public void setTag(String tag) {
		this.tag = tag;
	}

}
